class Solution(object):
    def compareVersion(self, version1, version2):
        """
        :type version1: str
        :type version2: str
        :rtype: int
        """
        v1 = version1.split('.')
        v2 = version2.split('.')
        index = 0
        while index < len(v1) and index < len(v2):
            if int(v1[index]) > int(v2[index]):
                return 1
            else:
                if int(v1[index]) < int(v2[index]):
                    return -1
            index += 1
        if index == len(v1):
            if index == len(v2):
                return 0
            else:
                for item in range(index, len(v2)):
                    if int(v2[item]) > 0:
                        return -1
                return 0
        else:
            for item in range(index, len(v1)):
                if int(v1[item]) > 0:
                    return 1
            return 0

data = Solution()
version1 = "1.00005.0.1"
version2 = "1.00005.0"
print(data.compareVersion(version1, version2))